<?php

namespace Aspic\Event;

use Aspic\Preset\OptionTrait;

/**
 * Event listener information
 *
 * @property string $eventName;
 * @property callable $callable;
 * @property integer $priority;
 */
class EventListener {

	const EVENT_PRIORITY_LOW = 0;

	const EVENT_PRIORITY_NORMAL = 1;

	const EVENT_PRIORITY_HIGH = 2;

	use OptionTrait;

	/**
	 * @var string Name of the event to listen to
	 */
	protected $_eventName;

	/**
	 * @var callable Callable to execute when event is triggered
	 */
	protected $_callable;

	/**
	 * @var integer Listener's priority
	 */
	protected $_priority;

	public function __construct($eventName, callable $callable, $priority = EventTriggerInterface::EVENT_PRIORITY_NORMAL) {
		$this->_eventName = $eventName;
		$this->_callable = $callable;
		$this->_priority = $priority;
	}

}
